home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 50
/
Aminet 50 (2002)(GTI - Schatztruhe)[!][Aug 2002].iso
/
Aminet
/
disk
/
bakup
/
DSrestore.lha
/
DSrestore
/
DSrestore.doc
< prev
next >
Wrap
Text File
|
2002-06-19
|
6KB
|
157 lines
This is a standalone command line application to restore archives in the
DiskSalv stream format. I wrote the first version because after
reformatting a partition which I previously backuped to a stream archive
I found out that the "restore" function didn't work exactly as I expected.
In fact all versions of DiskSalv I tried restore a stream archive by
putting all(!) the contents of the stream in the target dir - no structure
is left.
This is a really dissatisfying misfeature of an otherwise fine program.
You also notice this only eventually because DiskSalv keeps an
exclusive lock on the target dir, so you cannot even control the
progress by peeking into the directory.
So I set off to write a better restore routine for myself and here it is.
When I had finished I thought that there may be others who would be
thankful for a program like this, so I decided to refine
it a bit. The DiskSalv stream format supports all major AmigaDOS object
types. To be perfect, it only needs to support user and group bits, but
whoever needs this, may be better off with an ixemul application like
"tar" anyway.
The commandline pattern is:
DSrestore STREAM/A,TARGET,DEBUG/S,LOGFILE/K
STREAM: archive stream to be read
TARGET: target dir where the archive contents will be written to. Can
be omitted, the default is the current dir. When the target
directory can not be written to for what reason ever, the
program falls back to the SYS: dir. (I had no better idea,
really. :-) So be careful.
DEBUG: turn on lots of debugging output, which may be interesting if
something goes wrong.
LOGFILE: log the written files to this file. Default is no output. This
is "no output", not the file "no output". ;-)
This program comes with full source, including Dave Haynie's
ds_stream.h, which is according to the file header in the public domain.
I cleaned up the source a lot, but I think it's still quite ugly in some
parts.
Still a big TODO: Fix handling of softlinks in archive; restore links
to absolute paths because this is the way to go under AmigaOS.
Here comes the history straight from the RCS log, edited to be language
consistent.
RCS file: RCS/DSrestore.c
Working file: DSrestore.c
head: 3.3
branch:
locks: strict
obw: 3.3
access list:
symbolic names:
analyze: 2.1.1
keyword substitution: kv
total revisions: 16; selected revisions: 16
description:
restoring of DiskSalv stream archive.
----------------------------
revision 3.3 locked by: obw;
date: 2002/04/30 00:53:27; author: obw; state: Exp; lines: +9 -4
LOGFILE parameter now operational. :-)
----------------------------
revision 3.2
date: 2002/04/30 00:03:16; author: obw; state: Exp; lines: +17 -58
cleaned up source; replaced numerical errors with macros;
removed surplus routines; removed old variables; minor style
corrections.
----------------------------
revision 3.1
date: 2002/04/29 00:50:56; author: obw; state: Exp; lines: +18 -29
important memory allocations handled by pools; foundation for better
error handling. Now finally frees all memory at exit again!
----------------------------
revision 2.10
date: 2002/04/28 23:48:03; author: obw; state: Exp; lines: +9 -9
removed lots of exit()s.
----------------------------
revision 2.9
date: 2002/04/28 23:39:57; author: obw; state: Exp; lines: +39 -32
more memory cleanup
----------------------------
revision 2.8
date: 2001/12/30 20:45:45; author: obw; state: Exp; lines: +1 -0
FIX: mem leak fixed, now StdErr is closed when a command line parse error
occurs
----------------------------
revision 2.7
date: 2001/12/30 20:34:33; author: obw; state: Exp; lines: +1 -0
FIX: small memory leak fixed.
BUG: still a mem leak of 260 bytes at startup.
----------------------------
revision 2.6
date: 2001/12/30 20:10:11; author: obw; state: Exp; lines: +61 -27
all clib-memory allocations substituted by AmigaOS functions.
----------------------------
revision 2.5
date: 2001/03/03 14:17:32; author: obw; state: Exp; lines: +2 -2
forgotten variable corrected
----------------------------
revision 2.4
date: 2001/03/03 14:14:42; author: obw; state: Exp; lines: +24 -24
Error messages go to stderr now. Less SASlib-code.
----------------------------
revision 2.3
date: 2001/02/28 22:19:10; author: obw; state: Exp; lines: +48 -33
faster file copy, better memory handling.
FIX: correct memory allocation while copying.
FIX: defect files in archive are handled correctly.
ADD: stderr no open.
----------------------------
revision 2.2
date: 2001/02/28 00:13:19; author: obw; state: Exp; lines: +63 -32
quicker copying, lots of verbose output.
----------------------------
revision 2.1
date: 2001/02/26 23:50:24; author: obw; state: Exp;
branches: 2.1.1;
first version with full RCS and bumprev.
----------------------------
revision 2.1.1.3
date: 2001/02/28 00:20:51; author: obw; state: Exp; lines: +1 -1
errors corrected. final list-only version.
----------------------------
revision 2.1.1.2
date: 2001/02/27 22:46:07; author: obw; state: Exp; lines: +42 -18
working view-only version.
----------------------------
revision 2.1.1.1
date: 2001/02/27 00:01:59; author: obw; state: Exp; lines: +59 -54
"analyze-only" branch for testing of file format.
=============================================================================
DSrestore (C) 2001-2002 Oliver B. Warzecha <obw@amarok.ping.de>
This file is part of DSrestore.
DSrestore is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
DSrestore is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with DSrestore; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA